import BaseCURDApi from '@/framework/infra/base/BaseCURDApi'
import CheckStatusEnum from '@/infra/constant/CheckStatusEnum'

class RefundApplyApi extends BaseCURDApi {
  constructor() {
    super('pms/refund-apply')
  }

  check = ({ checkStatus, checkRemark, idList }) => {
    if (checkStatus === CheckStatusEnum.RESOLVE.id) {
      return this.post('resolve-refund', {
        id: idList[0]
      })
    }
    return this.post('reject-refund', {
      remark: checkRemark, id: idList[0]
    })
  }
}

export const refundApplyApi = new RefundApplyApi()
